package com.agendamobil;

import java.util.Date;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class AgendamobilActivity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
			
	 View btnnuevo;
	    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
                
        TextView fecha;	 fecha = (TextView) findViewById(R.id.fecha2);
        Date d = new Date();
        CharSequence s  = DateFormat.format("EEEE d MMMM yyyy ", d.getTime());
        fecha.setText(s);
        
//        btnnuevo = (Button) findViewById(R.id.button1);
//        btnnuevo.setOnClickListener(this); 
        
        btnnuevo = findViewById(R.id.button1);
        btnnuevo.setOnClickListener(this);
    
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (btnnuevo == v) {
			Intent i = new Intent(AgendamobilActivity.this, NuevoActivity.class);
			startActivity(i);
			// setContentView(R.layout.nuevo);
		}
	}

}